import asyncio
from dotenv import load_dotenv
load_dotenv()
from browser_use import Agent, BrowserSession
from browser_use.llm import ChatOllama

async def main():
    browser_session = BrowserSession(
        viewport={'width': 1920, 'height': 1080},
    )
    agent = Agent(
        task="打开 https://www.tapd.cn 如果未登录则登录，然后统计我第二季度完成的任务数量",
        llm=ChatOllama(model="qwen3:30b-a3b"),
        browser_session=browser_session
    )
    await agent.run()

asyncio.run(main())